
import { UsersService } from '../service/users.service';
import { Controller, Get, Param } from '@nestjs/common';
import { UsersDto } from 'src/core/dto/users.dto';
@Controller('users')
export class UsersController{
    //注入service
    constructor(private users:UsersService){}
    //获取资源
    @Get()
    async searchUsers():Promise<UsersDto[]>{
        return this.users.searchUsers();
    }
    @Get(':id')
    async getUser(@Param('id') id:string ):Promise<UsersDto>{
        return this.users.getUser(id);
    }

}